{% extends 'templates/default_template.html' %}
{%block content%}
<h1>{{user.name}} {% ifequal user.key logged_user.key %}(Me){%endifequal%}</h1>
<p>Area: {{user.area.name}}</p>
<h2>Projects</h2>
<div class="projectList">
  {% if user_projects %}
    {% for p in user_projects %}
      <div class="projectElement">
	<p>{{p.name}}</p>
	{% ifequal p.leader.key logged_user.key %}
	<p><a href="/users/me">You</a> are the leader of this project</p>
	{% else %}
	<p>Leader: <a href="/users/{{p.leader.key}}">{{p.leader.name}}</a></p>
	{% endifequal %}
	<div class="elementOptions">
	    <a href="/projects/{{p.key}}">View Project Details</a>
	</div>
      </div>
    {% endfor %}
  {% else %}
  <p>The user is in no projects.</p>
  {% endif %}
</div>
{%endblock content%}